//
//  MineHeader.swift
//  Xiaozihui
//
//  Created by 校企荟 on 2017/8/31.
//  Copyright © 2017年 校企荟. All rights reserved.
//

import UIKit

class MineHeader: UIView {

    lazy var headIV: UIImageView = {
        let iv = UIImageView()
        iv.layer.cornerRadius = 50 * ScaleX
        iv.layer.masksToBounds = true
        iv.backgroundColor = UIColor.white
        return iv
    }()
    
    lazy var nameLbl: UILabel = {
        return UILabel(content: "校资汇leftleftleftleftleftleftleftleftleftleftleft", textFont: UIFont.boldSystemFont(ofSize: 20 * ScaleX), color:UIColor.white, alignment: .left, numberOfLine: 1)
    }()

    lazy var schoolNameLbl: UILabel = {
        return UILabel(content: "上海大学leftleftleftleftleftleftleftleftleftleftleftleftleftleftleftleftleft", textFont: UIFont.systemFont(ofSize: 16 * ScaleX), color:UIColor.white, alignment: .left, numberOfLine: 2)
    }()
    
    override init(frame: CGRect) {
        super.init(frame: CGRect(x: 0, y: 0, width: ScreenWidth, height: 213 * ScaleX))
        setupUI()
        
    }
    
    func setupUI () {
        backgroundColor = mainColor
        addSubview(headIV)
        addSubview(nameLbl)
        addSubview(schoolNameLbl)
    
        headIV.snp.makeConstraints { (make) in
            make.width.height.equalTo(100 * ScaleX)
            
            make.left.equalTo(self).offset(20)
            make.bottom.equalTo(self).offset(-30)
        }
        
       
        
        nameLbl.snp.makeConstraints { (make) in
            make.left.equalTo(headIV.snp.right).offset(20)
            make.bottom.equalTo(headIV.snp.centerY).offset(-10)
            make.right.equalTo(self).offset(-10)
        }
        
        schoolNameLbl.snp.makeConstraints { (make) in
            make.left.equalTo(headIV.snp.right).offset(20)
            make.top.equalTo(headIV.snp.centerY).offset(10)
             make.right.equalTo(self).offset(-10)
        }
    }
    
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    

}
